#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "Person.h"
#include "Student.h"
#include "Teacher.h"

using namespace std;

TEST(Teacher, introduce_with_not_teaching_student)
{
    Klass klass(2);
    Teacher tom("1", "Tom", 21, {});
    Student jerry("1", "Jerry", 18, klass);
    string actual = tom.IntroduceWith(jerry);

    EXPECT_THAT(actual, ::testing::Eq("My name is Tom. I am 21 years old. I am a Teacher. I don't teach Jerry."));
}

TEST(Teacher, introduce_with_teaching_student)
{
    Klass klass(2);
    Teacher tom("1", "Tom", 21, {&klass});
    Student jerry("2", "Jerry", 18, klass);
    string actual = tom.IntroduceWith(jerry);

    EXPECT_THAT(actual, ::testing::Eq("My name is Tom. I am 21 years old. I am a Teacher. I teach Jerry."));
}

TEST(Teacher, introduce_with_klass_2_3)
{
    Klass klass2(2);
    Klass klass3(3);
    Teacher teacher("1", "Tom", 21, {&klass2, &klass3});

    Person &person = teacher;
    string actual = person.Introduce();

    EXPECT_THAT(actual, ::testing::Eq("My name is Tom. I am 21 years old. I am a Teacher. I am teaching Class 2,3."));
}

TEST(Teacher, introduce_with_no_klass)
{
    Teacher teacher("1", "Tom", 21, {});

    Person &person = teacher;
    string actual = person.Introduce();

    EXPECT_THAT(actual, ::testing::Eq("My name is Tom. I am 21 years old. I am a Teacher. I am teaching No Class."));
}